package org.jaronsource.framework.core.requesthistory;

import java.util.HashMap;
import java.util.Map;

public class RequestHistoryStorage {

	Map<String, RequestHistoryEntry> entris = new HashMap<String, RequestHistoryEntry>();

	private static final RequestHistoryStorage instance = new RequestHistoryStorage();

	private RequestHistoryStorage() {};

	public static RequestHistoryStorage getInstance() {
		return instance;
	}

	public Map<String, RequestHistoryEntry> getEntris() {
		return entris;
	}

	public void setEntris( Map<String, RequestHistoryEntry> entris ) {
		this.entris = entris;
	}

	public void addEntry(	String name,
							String requestURI,
							Map<String, Object> parameterMap ) {
		entris.put( name, new RequestHistoryEntry( name, requestURI, parameterMap ) );
	};

	public RequestHistoryEntry getEntry( String name ) {
		return entris.get( name );
	}
}
